﻿<%@ Control Language="C#" Inherits="Yuanlin.Business.AquacultureSection_RecommendThreads, Yuanlin.Business" AutoEventWireup="true" %>
<%@ Import Namespace="Yuanlin.Business" %>

<script runat="server" type="text/C#">
    private string GetThreadStatus(AquacultureSection_Thread thread)
    {
        if (thread.ThreadStatus.Value == 0)
        {
            return "PrefixCol ListImg";
        }
        else if (thread.ThreadStatus.Value == 1)
        {
            return "PrefixCol JianImg";
        }
        else if (thread.ThreadStatus.Value == 2)
        {
            return "PrefixCol DingImg";
        }
        else if (thread.ThreadStatus.Value == 3)
        {
            return "PrefixCol JingImg";
        }
        return "PrefixCol ListImg";
    }
</script>
<div id="aquaculturesection_recommendthreadcontainer" class="module">
    <div class="moduleHeader moduleHeaderContainer2">
        <nwap:ResourceLiteral runat="server" ResourceName="AquacultureSection" /><nwap:ResourceLiteral runat="server" ResourceName="tuilist" />
        <a class="<%= sectionId > 0 ? "right4" : "right3" %>" href="<%= SiteUrls.Instance().GetAquacultureSection_threadListUrl(sectionId,categoryType,categoryId) %>">帖子列表</a>
        <a class="<%= sectionId > 0 ? "right3" : "right2" %>" href="<%= SiteUrls.Instance().GetAquacultureSection_EssenceThreadListUrl(sectionId,categoryType,categoryId) %>">精华帖子</a>
        <a class="<%= sectionId > 0 ? "right2" : "right" %>" href="<%= SiteUrls.Instance().GetAquacultureSection_RecommendThreadListUrl(sectionId,categoryType,categoryId) %>">推荐帖子</a>
        <a class="<%= sectionId > 0 ? "right" : "nonedisplay" %>" href="<%= SiteUrls.Instance().GetAquacultureSection_AddThreadUrl(sectionId,categoryType,categoryId) %>">发表帖子</a>
    </div>
    <div class="moduleFrameCenter" runat="server" id="articleListPlaceHolder">
        <div class="moduleFrameCenterContainer">
            <div class="moduleFrameContent">
                <asp:Repeater ID="list" runat="server">
                    <HeaderTemplate>
                        <table border="0" cellpadding="0" cellspacing="0" class="AdminTable">
                            <thead>
                                <tr>
                                    <th class="PrefixCol"></th>
                                    <th class="TitleCol">主题</th>
                                    <th class="UpdateDateCol">更新时间</th>
                                    <th class="MostRecentReplyUserCol">回复人</th>
                                    <th class="CountCol">点击/回复</th>
                                    <th class="AuthorCol">作者</th>
                                </tr>
                            </thead>
                            <tbody>
                    </HeaderTemplate>
                    <ItemTemplate>
                        <tr>
                            <td class='<%# GetThreadStatus((AquacultureSection_Thread)Container.DataItem) %>'>
                            </td>
                            <td class="TitleCol">
                                <a target="_blank" href="<%# SiteUrls.Instance().GetAquacultureSection_threadUrl(((AquacultureSection_Thread)Container.DataItem).EntityId.Value,categoryType,categoryId) %>"><%# ((AquacultureSection_Thread)Container.DataItem).Subject.Value%></a><span class="<%# ((bool)(((AquacultureSection_Thread)Container.DataItem).CreateDate.Value > System.DateTime.Now.AddDays(-1))) ? "RecentIcon" : "Hidden" %>">
                                    &nbsp;&nbsp;&nbsp;&nbsp;</span>
                            </td>
                            <td class="UpdateDateCol">
                                <%# DataBinder.Eval(Container.DataItem, "UpdateDate", "{0:MM-dd HH:mm}")%>
                            </td>
                            <td class="MostRecentReplyUserCol">
                                <%# string.IsNullOrEmpty(((AquacultureSection_Thread)Container.DataItem).MostRecentReplierName.Value) ? "-" : ((AquacultureSection_Thread)Container.DataItem).MostRecentReplierName.Value%>
                            </td>                             
                            <td class="CountCol">
                                <%# ((AquacultureSection_Thread)Container.DataItem).TotalViews.Value%>/<%# ((AquacultureSection_Thread)Container.DataItem).TotalPosts.Value%>
                            </td>
                            <td class="AuthorCol">
                                <%# ((AquacultureSection_Thread)Container.DataItem).Author.Value%>
                            </td>
                        </tr>
                    </ItemTemplate>
                    <FooterTemplate>
                        </tbody> </table>
                    </FooterTemplate>
                </asp:Repeater>
            </div>
            <div class="PagingWrapper">
                <nwap:AjaxPager ID="pager" PageLength="11" TargetControlID="AquacultureSection_RecommendThreads" DataWrapperID="aquaculturesection_recommendthreadcontainer" runat="server" PageSize="30" />
            </div>
        </div>
    </div>
    <div class="moduleFrame">
        <div class="moduleFrameContainer">
            <div class="moduleFrameContentBottom">
            </div>
        </div>
    </div>
</div>